" location ~/.vimrc
" Ctl-n 补全, \+ci 注释

" 关闭兼容模式
set nocompatible

" 使用 vim-plug 管理插件
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
call plug#begin('~/.vim/plugged')

Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
let NERDTreeIgnore = ['\.pyc$', '__pycache__']
map <C-n> :NERDTreeToggle<CR>

Plug 'kien/ctrlp.vim'

"Plug 'vim-airline/vim-airline'
"set t_Co=256
"let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1

"Plug 'airblade/vim-gitgutter'
"set updatetime=300

"Plug 'ryanoasis/vim-devicons'

"Plug 'tpope/vim-surround'

call plug#end()



" vim 自身命令行模式智能补全
set wildmenu

" 总是显示状态栏
set laststatus=2
" 显示光标当前位置
set ruler

" 开启行号显示
set number
" 相对行
set relativenumber

" 开启实时搜索功能
set incsearch
" 高亮显示搜索结果
set hlsearch
" 搜索时候智能大小写
set smartcase
" 搜索时大小写不敏感
set ignorecase

" 设置C/C++方式自动对齐
set autoindent
set cindent

" 设置编码方式
set encoding=utf-8
"自动判断编码时 依次尝试一下编码
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

" 鼠标可用
set mouse=c

" tab缩进
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab

" 解决插入模式下delete/backspce键失效问题
set backspace=2
set clipboard=unnamed

" 粘贴模式
set paste

filetype plugin indent on
syntax on

" 关闭警告声
set noeb
set vb t_vb=

" 命令
command W w !sudo tee % > /dev/null


" onedark 主题
" Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
" If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
" (see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
  if (has("nvim"))
    "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
    let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  endif
  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  if (has("termguicolors"))
    set termguicolors
  endif
endif

" 颜色主题
colorscheme onedark
